'use strict';

var require = {
	baseUrl: (document.documentElement.lastChild.lastChild.src).replace(/(.*\/){0,}([^\.]+.*)/ig, '$1'),
	shim: {
		underscore: {
			exports: '_'
		},
		jquery: {
			exports: '$'
		},
		backbone: {
			deps: [
				'underscore',
				'jquery'
			],
			exports: 'Backbone'
		},
		backboneLocalstorage: {
			deps: ['backbone'],
			exports: 'Store'
		}
	},
	paths: {
		
		// 基础
		'underscore' : 'node_modules/underscore/underscore',
		'backbone'   : 'node_modules/backbone/backbone',
		'jquery'     : 'node_modules/jquery/dist/jquery',

		// require 插件
		'text' : 'node_modules/requirejs-text/text',
		'css'  : 'node_modules/require-css/css.min',

		// 特殊 require 插件，手动从 https://github.com/guybedford/require-less 下载，并作修改
		'less'  : 'custom_modules/require-less/less',
			'lessc'     : 'custom_modules/require-less/lessc',
			'normalize' : 'custom_modules/require-less/normalize',

		// backbone 插件
		'backbone.localstorage' : 'node_modules/backbone.localstorage/backbone.localStorage',
		'backbone.paginator'    : 'node_modules/backbone.paginator/lib/backbone.paginator',

		/* jquery 插件 */
		
		// 图片缩放
		'jquery.panzoom'    : 'node_modules/jquery.panzoom/dist/jquery.panzoom.min',
		// 文件上传
		'jquery.fileupload' : 'node_modules/blueimp-file-upload/js/jquery.fileupload',
		'jquery.ui.widget'  : 'node_modules/blueimp-file-upload/js/vendor/jquery.ui.widget',
		// 无限滚动加载
		'jquery.infinite-scroll' : 'custom_modules/jquery-infinite-scroll-helper/jquery.infinite-scroll-helper.min',
		// 多行文本省略号
		'jquery.dotdotdot' : 'custom_modules/dotdotdot/src/js/jquery.dotdotdot.min',

		// 对话框
		'drag'          : 'node_modules/artdialog/src/drag',
		'popup'         : 'node_modules/artdialog/src/popup',
		'dialog'        : 'node_modules/artdialog/src/dialog',
		'dialog-plus'   : 'node_modules/artdialog/src/dialog-plus',
		'dialog-config' : 'main/dialog-config',
		
		// 无限制拖动
		'draggabilly' : 'node_modules/draggabilly/dist/draggabilly.pkgd.min',
		
		// 微信 JS SDK
		'wx'          : 'main/wei-xin',
		'wei-xin-sdk' : 'http://res.wx.qq.com/open/js/jweixin-1.1.0',

		// 下拉刷新
		'material-refresh' : 'custom_modules/material-refresh/material-refresh',

		// 模板
		'Mustache' : 'node_modules/mustache/mustache.min'
	}
};
